package com.city.service.report.impl;
/**
 * @Author: 李顺时
 * @Description:
 * @Date: Create in 13:59 2018/9/7
 * @Modified By:
 * */

import com.city.domain.report.CtLegalPerson;
import com.city.repository.report.CtLegalPersonRepository;
import com.city.service.report.CtLegalPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CtLegalPersonServiceImpl implements CtLegalPersonService {

    @Autowired
    private CtLegalPersonRepository legalPersonRepository;

    @Override
    public CtLegalPerson findLegalPersonById(Integer id){ return legalPersonRepository.findLegalPersonById(id); }

    @Override
    public List<CtLegalPerson> findAll() {
        return legalPersonRepository.findAll();
    }

    @Override
    public CtLegalPerson findAllByCompanyName(String companyname) {
        return legalPersonRepository.findAllByCompanyName(companyname);
    }

    @Override
    public List<CtLegalPerson> findAllByName(String name) {
        return legalPersonRepository.findAllByName(name);
    }

    @Override
    public CtLegalPerson saveLegalPerson(CtLegalPerson legalPerson) {
        return legalPersonRepository.save(legalPerson);
    }
}
